package com.xiaoyang.ssyx.home.controller;

import com.xiaoyang.ssyx.client.product.ProductFeignClient;
import com.xiaoyang.ssyx.common.result.Result;
import com.xiaoyang.ssyx.model.product.Category;
import com.xiaoyang.ssyx.vo.search.SkuEsQueryVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @AUTHOR XiaoYang
 * @DATE 2023/6/29-13:49
 * @DESCRIPTION TODO
 */
@Api(tags = "商品分类")
@RestController
@RequestMapping("/api/home")
public class CategoryApiController {

    @Autowired
    private ProductFeignClient productFeignClient;

    //查询所有分类
    @GetMapping("category")
    public Result categoryList(){
        List<Category> allCategoryList = productFeignClient.findAllCategoryList();
        return Result.ok(allCategoryList);
    }

//    //根据分类查询商品
//    @GetMapping("{page}/{limit}")
//    public Result listSku(@PathVariable Long page,
//                          @PathVariable Long limit,
//                          SkuEsQueryVo skuEsQueryVo){
//
//    }

}
